package org.test.boot.rocketmq.consumer;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * push consumer demo
 */
@Service
@RocketMQMessageListener(topic = "${mq.user-topic}", consumerGroup = "push-consumer-group")
public class DemoConsumer implements RocketMQListener<String> {

    private static final Logger LOGGER = LoggerFactory.getLogger(DemoConsumer.class);

    public void onMessage(String message) {
        LOGGER.info("received message: {}", message);
    }
}